---
title: Charmhub | Deploy Gunicorn using Charmhub - The Open Operator Collection
description: Deploy the latest version of Gunicorn as a Kubernetes Operator on any
  cloud.
url: https://charmhub.io/gunicorn-k8s/docs/Getting started
---

# Gunicorn

[Franco Luciano Forneron Buschiazzo](https://charmhub.io/publisher/gtrkiller "View all packages from Franco Luciano Forneron Buschiazzo")

* [Franco Luciano Forneron Buschiazzo](https://charmhub.io/publisher/gtrkiller "View all packages from Franco Luciano Forneron Buschiazzo")

Platform:

stable 45

```
juju deploy gunicorn-k8s
```

[Learn to deploy on juju >](https://juju.is/docs/juju/manage-applications)

---

#### Relevant links

* [Homepage](https://github.com/canonical/gunicorn-k8s-operator/)

---

Share your thoughts on this charm with the community on discourse.

[Join the discussion](https://discourse.charmhub.io/)

# Quick guide

## What you’ll do

* Deploy the [Gunicorn-k8s charm](https://charmhub.io/gunicorn-k8s).
* Relate to [the PostgreSQL K8s charm](https://charmhub.io/postgresql-k8s).
* Inject new environment variables to gunicorn-k8s.
* Relate to [the InfluxDB charm](https://charmhub.io/influxdb).

To deploy the charm and relate it to
[the PostgreSQL K8s charm](https://charmhub.io/postgresql-k8s) within a Juju Kubernetes model:

```
juju deploy postgresql-k8s
juju deploy gunicorn-k8s
juju relate postgresql-k8s:db gunicorn-k8s:pg
```

To inject a new env variable:

```
juju config gunicorn-k8s environment="DB_URI: {{pg.db_uri}}"
```

Also try other options like just putting a random string or relation variables like pg.conn\_str (variables from relations always have to be put between double curly braces).

To deploy the charm and relate it to influxdb, assuming you have a machine model for influx and a k8s model for gunicorn:

```
juju switch machine-ctrl:admin/influx-model
juju deploy influxdb
juju offer influxdb:query influxoffer
juju switch k8s-ctrl:admin/gunicorn_model
juju deploy gunicorn-k8s
juju relate gunicorn-k8s machine-ctrl:admin/influx-model.influxoffer
```

The charm also supports the `ingress` relation, which can be used with
[nginx-ingress-integrator](https://charmhub.io/nginx-ingress-integrator/).

```
juju deploy nginx-ingress-integrator
juju relate gunicorn-k8s:ingress nginx-ingress-integrator:ingress
```

---
